Part Number Hot Search : 
MF514200 AS5306A SMA70 B1202 05S07 20M63 TA58L05 GMBT2411
Product Description
Full Text Search
 

To Download AN103 Datasheet File

  If you can't view the Datasheet, Please click here to try to view without PDF Reader .  
 
 


  Datasheet File OCR Text:
  application note 1 of 6 www.xicor.com october, 2000 an 103 interfacing the x84129 mps eeprom to the motorola 68hc11 microcontroller by applications staff this application note demonstrates how the xicor x84129 mps eeprom can be interfaced to the 68hc11 microcontroller family when connected as shown in figure 1. the interface uses the time-multi- plexed address/data bus and two control lines of the 68hc11 to interface to the mps eeprom. although the x84129 requires minimal glue logic, 3-nand gates when connected to the 68hc11, the advantage of the mps eeprom as a port-less serial memory device is still preserved. the 68hc11 assembly code listing for this application note can be obtained from the web site at http://www.xicor.com. pa 3 pa 4 pa 5 pa 6 pa 7 a15/pb7 a14/pb6 a13/pb5 a12/pb4 a11/pb3 a10/pb2 a9/pb1 a8/pb0 ad7/pc7 ad6/pc6 ad5/pc5 ad4/pc4 ad3/pc3 ad2/pc2 ad1/pc1 ad0/pc0 r/w e as xt ex reset irq xirq pa 0 pa 1 pa 2 pe0 pe1 pe2 pe3 vrh vrl 68hc11a8 e3 e2 e1 a2 a1 a0 y0 y1 y2 y3 y4 y5 y6 y7 v cc gnd 74ht138 ce we oe wp i/o x84129 74ct100 figure 1. typical hardware connection for interfacing an x84641/129 to the 68hc11 microcontroller.
2 of 6 an 103 application note www.xicor.com october, 2000 ******************************************************************************* ** ** description: ** ** this file contains general utility routines written in 68hc11 assembly ** language used to interface the 68hc11 to the xicor x84161/641/129 mps e 2 prom. ** the interface uses the 68hc11 parallel bus and two control lines to connect ** to the x84161/641/129 . the microcontroller r/w and e control lines are connected ** through 3 nand gates to match the x84161/641/129? /oe and /we control lines. ** address lines a15, a14, a13 are decoded for the chip select; mapping the ** x84161/641/129 to address space 6000 - 7fff. ** the following table lists all the subroutines in this file with a brief ** description: ** ** resetd: resets the device before a read or write can take place ** page_write: writes a page of data to the device ** page_read: reads a page of data from the device into the uc? ram ** byte_read: reads a byte of data from the device into the uc? ram ** byte_write: writes a byte of data to the device ** inbyte: called by read subroutines to shit data in ** outbyte: called by write subroutines to shit data out ** sndaddr: called by read/write subroutines to send address to device ** snvwrte: provides start non-volatile write sequence required for all writes ** checknvw: checks to makes sure the non-volatile write is completed ** ** the main program writes a test string into the mps e 2 prom. after ** page is programmed, the first byte of the page is altered. the page is ** then read back and written to a different location in memory. ** the data read is temporarily stored in the internal ram. ** ******************************************************************************* ******************************************************************************* * internal ram ******************************************************************************* rambase equ $0000 the internal ram base address(default) rambuff equ rambase ram buffer address stack equ rambase+$ff ******************************************************************************* * program constants ******************************************************************************* address equ $6000 mpsaddress equ $0000 mpsaddress2 equ $0100 page_size equ 32 ******************************************************************************* * reset vector entry point ******************************************************************************* org $fffe reset vector address to program entry
3 of 6 an 103 application note www.xicor.com october, 2000 fdb $e000 jump to beginning of executable code * assembler requirement- cpu type p68h11 ******************************************************************************* * start of user code * ******************************************************************************* org $e000 main: lds #stack * load stack pointer * initialize the buffer before programming the content to a sector ldx #teststring * ix = test string address ldy #mpsaddress * address within mps to write data to jsr page_write * write data to the first page ldy #mpsaddress * address within mps to write byte to jsr byte_write * write byte to the first address location ldy #mpsaddress * address within mps to read from jsr page_read * read data in the first page ldx #rambuff * set ix data pointer to data just read ldy #mpsaddress2 * address within mps to write data to jsr page_write * write data to page 0100 hex done: jmp done ******************************************************************************* *** name: resetd *** description: sends reset sequence to the device. *** function: performs a read, write "0", read *** calls: *** input: *** output: *** register usage: a ******************************************************************************* resetd: ldaa address * sends read command clra * clear accum staa address * send write "0" command ldaa address * sends read command rts ******************************************************************************* *** name: page_write *** description: *** function: writes a page of data to the first address. *** calls: sndaddr, outbyte *** input: *** output: *** register usage: x, y ******************************************************************************* page_write:
4 of 6 an 103 application note www.xicor.com october, 2000 jsr sndaddr * send page address to device ldy #page_size * y register contains number of bytes/page pagepw: ldaa 0,x * load the "test string" in the x register pshy jsr outbyte * sends out the byte in the accum puly inx * increments the x register dey * decrements the page counter bne pagepw * branches until all bytes are written jsr snvwrte * start nonvolatile write jsr checknvw * checks completion of non-volatile write rts ******************************************************************************* *** name: page_read *** description: *** function: reads a page of data from the first address. *** calls: sndaddr, inbyte *** input: *** output: *** register usage: x, y ******************************************************************************* page_read: jsr sndaddr * send page address to device ldy #page_size * y register contains number of bytes/page ldx #rambuff * sets the index register x to 0 pagepr: pshy jsr inbyte * receives the byte of data puly staa 0,x * stores the byte to ram inx * increments the x register dey * decrements the page counter bne pagepr * branches until all bytes are read rts ******************************************************************************* *** name: byte_read *** description: *** function: reads a byte of data from the first address. *** calls: sndaddr, inbyte *** input: *** output: *** register usage: x ******************************************************************************* byte_read: jsr sndaddr * send byte address to device ldx #rambuff * sets the index register x to 0 pagebr: jsr inbyte * receives the byte of data staa 0,x * stores the byte to ram rts ******************************************************************************* *** name: inbyte *** description: reads in 8 bits *** function: *** calls:
5 of 6 an 103 application note www.xicor.com october, 2000 *** input: *** output: *** register usage: y ******************************************************************************* inbyte: ldy #$8 * sets y to 8 clra * clears accum out2: ldab address * load bit from device to accum b andb #00000001b * mask-out unwanted bits accum b rola * rotate accum 1 bit to the left aba * mask accum b into accum a dey bne out2 * branch until accum a contains complete byte rts ******************************************************************************* *** name: byte_write *** description: *** function: writes a byte of data to the first address. *** calls: sndaddr, outbyte *** input: *** output: *** register usage: ******************************************************************************* byte_write: jsr sndaddr * send byte address to device ldaa #$58 * load accum with "x" jsr outbyte * send jsr snvwrte * start nonvolatile write jsr checknvw * checks completion of non-volatile write rts ******************************************************************************* *** name: sndaddr *** description: send address to the device *** function: writes the 16 bit address to the device. *** calls: resetd, outbyte *** input: *** output: *** register usage: y ******************************************************************************* sndaddr: jsr resetd * send the reset signal xgdy * load the address in y to double accum jsr outbyte * send msb of address tba * transfer lsb to accum a jsr outbyte * send lsm of address rts ******************************************************************************* *** name: outbyte *** description:
6 of 6 an 103 application note www.xicor.com october, 2000 *** function: sends out 8 bits to address. *** calls: *** input: *** output: *** register usage: y ******************************************************************************* outbyte: ldy #$8 rola out1: rola staa address dey bne out1 rts ******************************************************************************* *** name: snvwrte *** description: *** function: sends out 8 bits to address. *** calls: *** input: *** output: *** register usage: ******************************************************************************* snvwrte: ldaa address * sends read command ldaa #$1 * set accum to "1" staa address * send write "1" command ldaa address * sends read command rts ******************************************************************************* *** name: checknvw *** description: *** function: *** calls: *** input: *** output: *** register usage: ******************************************************************************* checknvw: ldaa address? * sends read command rora * rotate d0 to the carry bit bcc checknvw * loop if nonvolatile write is occuring rts teststring: fcc 'xicormpsxicormpsxicormpsxicormps' ******************************************************************************* *** end of x84161/641/129 mps interterface source code ******************************************************************************* end


▲Up To Search▲   

 
Price & Availability of AN103

All Rights Reserved © IC-ON-LINE 2003 - 2022  

[Add Bookmark] [Contact Us] [Link exchange] [Privacy policy]
Mirror Sites :  [www.datasheet.hk]   [www.maxim4u.com]  [www.ic-on-line.cn] [www.ic-on-line.com] [www.ic-on-line.net] [www.alldatasheet.com.cn] [www.gdcy.com]  [www.gdcy.net]


 . . . . .
  We use cookies to deliver the best possible web experience and assist with our advertising efforts. By continuing to use this site, you consent to the use of cookies. For more information on cookies, please take a look at our Privacy Policy. X